<!DOCTYPE html>
<html>

<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="edge">
    <meta name="viewport" content="width=device-width, initial-scale=1,maximum-scale=1.0,user-scalable=0">
    <meta content="telephone=no" name="format-detection" />
    <meta name="description" content="">
    <meta name="keywords" content="">
    <title>知识库-话题</title>
    <link rel="stylesheet" type="text/css" href="css/reset.css">
    <link rel="stylesheet" type="text/css" href="css/mobiscroll.css">
    <link rel="stylesheet" type="text/css" href="css/global.css">
    <link rel="stylesheet" type="text/css" href="css/media.css">
    <style type="text/css" media="screen">
        [v-cloak] {
            display: none;
        }
    </style>
    <style type="text/css">
        div.jHtmlArea {
            width: 89%;
            resize: none;
            height: 2rem;
            border: 1px solid #ccc;
            outline: none;
            height: 6rem;
        }
    </style>
</head>

<body id="app">
    <!-- 头部 -->
    <header class="header">
        <a href="javascript:;" title="返回" class="icon back" @click="back();"></a>
        <h1 class="pr" v-cloak data-typeID="{{typeID}}">{{title}}
            <!-- <i class="down"></i>
            <select id="names" class="block-select-opt" data-role="none" >
                <option value="{{block.id}}" v-for="block in blocks" v-cloak>{{block.name}}</option>
            </select> -->
        </h1>
        <a href="javascript:void(0);" title="提交" class="text" @click="publish();">回答</a>
    </header>

    <section class="padT23 publish">
        <textarea class="mar24 pad24 dn" placeholder="标题（最多60个中文）" v-model="askTitle" id="askTitle"></textarea>
        <textarea class="mar24 pad24" placeholder="内容" v-model="askContent" id="askContent"></textarea>
        <span class="db">
            <i @click="addphoto();"></i>
        </span>
        <ul class="clearfix photo" v-show="addphotoshow" id="dom">
            <li class="imgBox">
                <form id="am_form" method="post" enctype="multipart/form-data">
                    <img src="images/addphoto.png" @click="selectPic();">
                    <input type="file" class="uploadFile" id="pic" name="uploadFile">
                </form>
            </li>
            <!-- <li class="imgBox j_1" >
                <i class="closeImg" onclick="delImg(this);"></i>
                <img :src="contentPicture" id="pic1" class="loadImg">
            </li> -->
        </ul>
    </section>


    <script type="text/javascript" src="js/lib/jquery.min.js"></script>
    <script type="text/javascript" src="js/lib/vue.js"></script>
    <script type="text/javascript" src="js/lib/common.js"></script>
    <script type="text/javascript" src="js/lib/global.js"></script>
    <script type="text/javascript" src="js/lib/mobiscroll.js"></script>
    <script type="text/javascript" src="js/lib/alert.js"></script>
    <script type="text/javascript" src="js/circleAddComment.js"></script>
    <script type="text/javascript" src="js/lib/jquery.form.js"></script>
    <script type="text/javascript" src="js/lib/jHtmlArea-0.8.js"></script>
    <script type="text/javascript">
        function delImg(e) { //删除图片
            $(e).parent().remove();
            var data = $(e).next().attr('src');
            data = Common.jsonEncode(data);
            Common.ajaxCall({
                url: 'common_deletePic',
                datatype: 'json',
                type: 'get',
                data: data
            }, function(data) {
                if (data.error_code == 0) {
                    alert(data.msg);
                } else {
                    alert(data.msg);
                }
            });
        }
        //初始化富文本
        $(function() {
            $("#askContent").htmlarea();
            $(".ToolBar").hide();
            $(".jHtmlArea").addClass("mar24 pad24");

            $('#askContent').htmlarea('initHtmlArea', function(hd) {
                $(".jHtmlArea").css("background-color", "#f0f0f0");
                hd.focus(function() {
                    $(".jHtmlArea").css({
                        "background-color": "",
                        "border-color": "#03A9F4"
                    });
                });
                hd.blur(function() {
                    $(".jHtmlArea").css({
                        "background-color": "#f0f0f0",
                        "border-color": "#ccc"
                    });
                });
            });
        });
    </script>
</body>

</html>